﻿using System;
using System.IO;

namespace _016_流之使用StreamReader类读取文本文件
{
    class Program
    {
        static void Main(string[] args)
        {

            写点东西到文本中();

            using (StreamReader 读取=new StreamReader("demo.txt"))
            {
                string 行 = null;
                while ((行=读取.ReadLine())!=null)
                {
                    Console.WriteLine(行);
                }
            }

        }

        static void 写点东西到文本中()
        {
            using (StreamWriter 写操作=new StreamWriter("demo.txt"))
            {
                写操作.WriteLine("first line");
                写操作.WriteLine(50000L);
                写操作.WriteLine(0.000075d);
                写操作.WriteLine(6000);
            }
        }
    }
}
